set nu 

syntax on
set wildmenu
set autowrite
"set cursorline
set smartindent
set shiftwidth=4
set tabstop=4
set softtabstop=4
set expandtab
set encoding=utf-8
set termencoding=utf-8
set fileencoding=utf-8
set mouse-=a
set nocompatible
set backspace=2
" set nobackup
" set noswapfile

set background=dark
"colorscheme af
"colorscheme abbolt
"colorscheme cool
"colorscheme lightning
"colorscheme luna
" colorscheme night
colorscheme garden
" colorscheme mushroom
set nobackup
set nowritebackup
set noundofile
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.pyc,*.meta
set laststatus=2
""""""""""Plug
set rtp+=~/.vim/autoload/Plug.vim
" plug init
call plug#begin('C:/Users/Administrator/vimfiles/plug')
Plug 'preservim/nerdtree'
Plug 'junegunn/fzf',{'do':{->fzf#install()}}
Plug 'junegunn/fzf.vim'
Plug 'flazz/vim-colorschemes'
Plug 'majutsushi/tagbar'
Plug 'vim-airline/vim-airline'
" 快速注释与注释文档
Plug 'scrooloose/nerdcommenter'
Plug 'vim-scripts/DoxygenToolkit.vim'
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug 'dyng/ctrlsf.vim'   "全局文件内容搜索
Plug 'mg979/vim-visual-multi', {'branch': 'master'}
Plug 'OmniSharp/omnisharp-vim'
Plug 'puremourning/vimspector'
Plug 'junfff/vim-unity-debug'
Plug 'dense-analysis/ale'
Plug 'ludovicchabant/vim-gutentags'
"Plug 'airblade/vim-rooter'
Plug 'thinca/vim-localrc'
Plug 'mhinz/vim-startify'
Plug 'voldikss/vim-translator'

if has('nvim')
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins'  }
else
Plug 'Shougo/deoplete.nvim'
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
endif

if has('win32') || has('win64')
  Plug 'tbodt/deoplete-tabnine', { 'do': 'powershell.exe .\install.ps1' }
else
  Plug 'tbodt/deoplete-tabnine', { 'do': './install.sh' }
endif




"""""""languge syntax 
Plug 'Mathijs-Bakker/vim-unity-snippets'
Plug 'nickhutchinson/vim-cmake-syntax'
Plug 'octol/vim-cpp-enhanced-highlight'
Plug 'pangloss/vim-javascript'
Plug 'leafgarland/typescript-vim'
Plug 'tbastos/vim-lua'
Plug 'tikhomirov/vim-glsl'
Plug  'walston/vim-shaderlab'
Plug 'jiangmiao/auto-pairs'
call plug#end()

""""""""""""""tabnine
call deoplete#custom#var('tabnine', {
\ 'line_limit': 500,
\ 'max_num_results': 20,
\ })
"""""""""""""tabnine end""""""""



"""""""""""Plug_end

"let g:tmuxline_powerline_separators = 2 " tmuxline

" """""""""""Nerdtree
" map <F4> :NERDTreeToggle<CR>
" let g:NERDTreeDirArrowExpandable = '▸'
" let g:NERDTreeDirArrowCollapsible = '▾'
" let NERDTreeIgnore=['\.meta'] "filter file

" """""""""""Nerdtree end


" " fzf config
" map <leader>p :Files<CR>!.meta$ 
" nmap <leader>buf :Buffers<CR>
" "map <leader>f :lvimgrep
" "let g:fzf_layout = {'down' : '~40%;'}
" let g:fzf_layout = {'window':{'width':0.9,'height':0.6,'offset':1}}
" let g:fzf_action = {
"   \ 'ctrl-t': 'tab split',
"   \ 'ctrl-x': 'split',
"   \ 'ctrl-v': 'vsplit' }

" " - Window using a Vim command
" "let g:fzf_layout = { 'window': 'enew' }
" "let g:fzf_layout = { 'window': '-tabnew' }
" "let g:fzf_layout = { 'window': '10new' }

" " Customize fzf colors to match your color scheme
" " - fzf#wrap translates this to a set of `--color` options
" let g:fzf_colors =
" \ { 'fg':      ['fg', 'Normal'],
"   \ 'bg':      ['bg', 'Normal'],
"   \ 'hl':      ['fg', 'Comment'],
"   \ 'fg+':     ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
"   \ 'bg+':     ['bg', 'CursorLine', 'CursorColumn'],
"   \ 'hl+':     ['fg', 'Statement'],
"   \ 'info':    ['fg', 'PreProc'],
"   \ 'border':  ['fg', 'Ignore'],
"   \ 'prompt':  ['fg', 'Conditional'],
"   \ 'pointer': ['fg', 'Exception'],
"   \ 'marker':  ['fg', 'Keyword'],
"   \ 'spinner': ['fg', 'Label'],
"   \ 'header':  ['fg', 'Comment'] }











"   """"""""""""""""deoplete
" set rtp+=~/.vim/plugged/deoplete.nvim
" let g:deoplete#enable_at_startup = 1
" let g:python3_host_prog = "C:/Users/Administrator/AppData/Local/Programs/Python/Python39/python.exe"

" """""""""""""""""""""""""omnisharp-vim
" let g:OmniSharp_server_stdio = 1
" let g:OmniSharp_server_use_mono = 1
" " nmap <leader> gd :OmniSharpGotoDefinition
" autocmd FileType cs nmap <silent> <buffer> <Leader>gd <Plug>(omnisharp_go_to_definition)
" autocmd FileType cs nmap <silent> <buffer> <Leader>fu <Plug>(omnisharp_find_usages)

" """""""""""""""""""""""""ultisnips

" "better key bindings for UltiSnipsExpandTrigger
" "let g:UltiSnipsUsePythonVersion=3
" let g:UltiSnipsExpandTrigger = "<tab>"
" let g:UltiSnipsJumpForwardTrigger = "<tab>"
" let g:UltiSnipsJumpBackwardTrigger = "<s-tab>"
" let g:UltiSnipsSnippetDirectories = ['UltiSnips','UnitySnippets']


" """""""""""""""""""""""""ultisnips end 

" """"""""""""""""""""""""'vimspector
" " vim-lldb Settings
" "let g:lldb_map_Lstart = "<F7>"
" "let g:lldb_map_Lcontinue = "<F6>"
" "let g:lldb_map_Lbreakpoint = "<F9>"
" "let g:lldb_map_Lnext = "<F10>"
" "let g:lldb_map_Lstep = "<F11>"
" let g:vimspector_enable_mappings = 'VISUAL_STUDIO'

" """""""""""""""""""""""""NERDCOMMENTER
" "<leader>cc   加注释
" "<leader>cu   解开注释
" "<leader>ca 切换注释的样式:/*....*/和//..的切换
" "<leader>c<space>  加上/解开注释, 智能判断
" "<leader>cy   先复制, 再注解(p可以进行黏贴)
" "<leader>cs  注释
" "
" """""""""""""""""""DoxygenToolKit
" let g:DoxygenToolkit_briefTag_funcName = "yes"

" " for C++ style, change the '@' to '\'
" let g:DoxygenToolkit_commentType = "C++"
" let g:DoxygenToolkit_briefTag_pre = "\\brief "
" let g:DoxygenToolkit_templateParamTag_pre = "\\tparam "
" let g:DoxygenToolkit_paramTag_pre = "\\param "
" let g:DoxygenToolkit_returnTag = "\\return "
" let g:DoxygenToolkit_throwTag_pre = "\\throw " " @exception is also valid
" let g:DoxygenToolkit_fileTag = "\\file "
" let g:DoxygenToolkit_dateTag = "\\date "
" let g:DoxygenToolkit_authorTag = "\\author "
" let g:DoxygenToolkit_versionTag = "\\version "
" let g:DoxygenToolkit_blockTag = "\\name "
" let g:DoxygenToolkit_classTag = "\\class "
" let g:DoxygenToolkit_authorName = "yummy"
" let g:doxygen_enhanced_color = 1
" "let g:load_doxygen_syntax = 1
" let g:DoxygenToolKit_startCommentBlock = "/// "
" let g:DoxygenToolKit_interCommentBlock = "/// "

" """""""""""""""""""""""""""ctrlsf 全局文件内容搜索
" "let g:ackprg='ag' // 设置ctrlsf 使用ag
" let g:ackprg='ag --nogroup --nocolor --nocolumn' ""设置ctrlsf 使用ag 
" nnoremap <leader>f :CtrlSF<Space>
" map <s-j> <c-j>p
" map <s-u> <c-k>p 
" let g:ctrlsf_default_view_mode = 'compact'
" let g:ctrlsf_auto_close = {
"     \ "normal" : 0,
"     \ "compact": 0
"     \}

" let g:ctrlsf_auto_focus = {
"     \ "at": "start"
"     \ }
" let g:ctrlsf_mapping = {
"     \ "next": "n",
"     \ "prev": "N",
"     \ }

" "brew install the_silver_searcher

" """"""""""""""gutentags """"""""""""""
" " gutentags搜索工程目录的标志，碰到这些文件/目录名就停止向上一级目录递归 "
" let g:gutentags_project_root = ['.root', '.svn', '.git', '.project']

" " 所生成的数据文件的名称 "
" let g:gutentags_ctags_tagfile = '.tags'

" " 将自动生成的 tags 文件全部放入 ~/.cache/tags 目录中，避免污染工程目录 "
" let s:vim_tags = expand('C:/Users/Administrator/.cache/tags')
" let g:gutentags_cache_dir = s:vim_tags
" " 检测 ~/.cache/tags 不存在就新建 "
" if !isdirectory(s:vim_tags)
"    silent! call mkdir(s:vim_tags, 'p')
" endif

" " 配置 ctags 的参数 "
" " let g:gutentags_ctags_extra_args = ['--fields=+niazS', '--extra=+q']
" " let g:gutentags_ctags_extra_args += ['--c++-kinds=+pxI']
" " let g:gutentags_ctags_extra_args += ['--c-kinds=+px']
" """""""""""""""""gutentags end """""""""""""""""

" """"""""""""""""""""""""ale syntax
" let g:ale_set_highlights = 0
" "自定义error和warning图标
" let g:ale_sign_error = '✗'
" let g:ale_sign_warning = '!'
" "在vim自带的状态栏中整合ale
" let g:ale_statusline_format = ['✗ %d', ' %d', ' OK']
" "显示Linter名称,出错或警告等相关信息
" let g:ale_echo_msg_error_str = 'E'
" let g:ale_echo_msg_warning_str = 'W'
" let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
" "打开文件时进行检查
" let g:ale_lint_on_enter = 1

" "普通模式下，sp前往上一个错误或警告，sn前往下一个错误或警告
" nmap sp <Plug>(ale_previous_wrap)
" nmap sn <Plug>(ale_next_wrap)
" "<Leader>s触发/关闭语法检查
" nmap <Leader>s :ALEToggle<CR>
" "<Leader>d查看错误或警告的详细信息
" nmap <Leader>d :ALEDetail<CR>
" "使用clang对c和c++进行语法检查
" let g:ale_linters = {
" \   'c++': ['clang'],
" \   'c': ['clang'],
" \   'cs': ['OmniSharp']
" \}


" """"""""""""""language syntax config
" let g:lua_syntax_someoption = 1
" let g:javascript_plugin_jsdoc = 1
" let g:javascript_plugin_ngdoc = 1
" """""""cpp 
" let g:cpp_class_scope_highlight = 1
" let g:cpp_member_variable_highlight = 1
" let g:cpp_class_decl_highlight = 1
" let g:cpp_posix_standard = 1
" let g:cpp_experimental_simple_template_highlight = 1
" let g:cpp_experimental_template_highlight = 1
" let g:cpp_concepts_highlight = 1
" let g:cpp_no_function_highlight = 1
" autocmd! BufNewFile,BufRead *.fs,*.vs,*.gs,*.vert,*.frag set ft=glsl

" """"""""operation""""""""
" nmap <leader>1 <C-w>h
" nmap <leader>2 <C-w>j
" nmap <leader>3 <C-w>k
" nmap <leader>4 <C-w>l
" vmap <leader>f y/<C-r>"
" vmap <leader>gf y<leader>f<C-r>"
source C:/Users/Administrator/vimfiles/.config.vimrc
